package com.tecode.myBooks.request;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

/**
 * Created with Intellij IDEA.
 *
 * @Author: Gabriel
 * @Date: 2018-12-10
 * @Description:
 */
public class MyServletRequestWrapper extends HttpServletRequestWrapper {

	public MyServletRequestWrapper(HttpServletRequest request) {
		super(request);
	}


	@Override
	public String getParameter(String name) {
		String nameValue = super.getParameter(name);
		System.out.println(nameValue);
		if(nameValue !=null && nameValue.contains("fuck")){
			nameValue = nameValue.replaceAll("fuck", "****");
		}

		return nameValue;
	}
}